export default {
  namespaced: true,
  state () {
    return {
      fileList: [],
      fileList2: [],
      fileList3: [],
      fileList4: [],
      fileList5: [],
      fileList6: [],
      form: {},
      arr: []
    }
  },
  mutations: {
    SETFILELIST (state, data) {
      state.fileList.push({ url: data })
    },
    SETFILELIST2 (state, data) {
      state.fileList2.push({ url: data })
    },
    SETFILELIST3 (state, data) {
      state.fileList3.push({ url: data })
    },
    SETFILELIST4 (state, data) {
      state.fileList4.push({ url: data })
    },
    SETFILELIST5 (state, data) {
      state.fileList5.push({ url: data })
    },
    SETFILELIST6 (state, data) {
      state.fileList6.push({ url: data })
    },
    SETDELETEFILELIST (state, data) {
      for (let i = 0; i < state.fileList.length; i++) {
        if (state.fileList[i].url === data) {
          state.fileList.splice(i, 1)
        }
      }
    },
    SETFORM (state, data) {
      state.form = data
      state.arr.push(data)
      // console.log(state.arr)
      // localStorage.setItem('fileList', state.arr)
      // state.form.fileList.url = window.URL.createObjectURL(data.fileList[0].url)
    },
    UPDATEFORM (state, data) {
      state.form = data
    },
    UPDATAArr (state, data) {
      state.arr = state.arr.filter((item, index) => {
        return item.name !== data
      })
    }
  },
  actions: {

  }
}
